/**
 * <AiRmob-Framework; A simple augmented reality framework for android >
    Copyright (C) <2012>  <AiRmob Team>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package rendercomponents;

public class ModelSphere extends Model3D {

	 /**
	  * Generates a sphere. Is imported from models/examples/sphere.obj and models/examples/sphere.mtl.
	  * Has a white texture and bright, white materialcolors.
	  * 
	  * @param r Used Renderer.
	  */
	 public ModelSphere(Renderer r){
		 super();
		 ModelCustom swap =  new ModelCustom(r, "models/examples/sphere.obj", ModelFileTypes.OBJ); 
		 
		 this.setbVertexBuffer(swap.getbVertexBuffer());
		 this.setbIndexBuffer(swap.getbIndexBuffer());
		 this.normalsSet = true;
		 this.textureCoordsSet = true;
		 this.textureSet = true;
		 
		 this.setMaterialAmbient(swap.getMaterialAmbient());
		 this.setMaterialDiffuse(swap.getMaterialDiffuse());
		 this.setMaterialSpecular(swap.getMaterialSpecular());
		 this.setMaterialExponent(swap.getMaterialExponent());
		 
		 this.texture = swap.texture;
		 
		 if (r.settings.useVBO){
				this.mesh.vBuffer = swap.mesh.vBuffer;
				this.iBuffer = swap.iBuffer;
				this.numIndices = swap.numIndices;
			}
	 }

}